from concurrent.futures import ThreadPoolExecutor
from other.new_user_retain.country_retain import country_retain_rate


def create_thread_pool():
    """
    create thread pool default max_workers  = 100
    :return: pool
    """
    return ThreadPoolExecutor(max_workers=100)


pool = create_thread_pool()

pool.submit(country_retain_rate, '2021-07-01', '2018-01-01', '2021-11-01')
pool.submit(country_retain_rate, '2021-08-01', '2018-01-01', '2021-11-01')
pool.submit(country_retain_rate, '2021-09-01', '2018-01-01', '2021-11-01')
pool.submit(country_retain_rate, '2021-10-01', '2018-01-01', '2021-11-01')
